<template>
  <div class="cate-root root">
    <h1 class="title">直播分类</h1>
    <div class="cates-test" v-if="!cates">
      <a v-for="i in 11" :key="i"></a>
    </div>
    <div class="cates" v-else>
      <router-link
        v-for="(cateObj, i) in cates"
        :key="i"
        :to="'/list/' + cateObj.cate_id"
        >{{ cateObj.cate_name }}</router-link
      >
    </div>
  </div>
</template>
<script>
export default {
  name: "DYCate",
  data() {
    return {
      cates: null,
    };
  },
  activated() {
    setTimeout(() => {
      this.axios.get("/api/v1/getColumnList").then((res) => {
        this.cates = res.data.data;
      });
    }, 5000);
  },
};
</script>
<style scoped>
.cates,
.cates-test {
  display: flex;
  flex-wrap: wrap;
}
.cates > a {
  flex-grow: 1;
  display: block;
  width: 30%;
  height: 8vh;
  border: 1px dashed red;
  text-align: center;
  line-height: 8vh;
}

.cates-test > a {
  flex-grow: 1;
  display: block;
  width: 30%;
  height: 8vh;
  background-color: yellow;
  margin: 5px;
  border-radius: 10px;
  text-align: center;
  line-height: 8vh;
  animation: opc 2s linear infinite;
}
@keyframes opc {
  0% {
    opacity: 0.7;
  }
  100% {
    opacity: 0.5;
  }
}
</style>
